package com.kjj.user.rabbitmq.handler;

import com.kjj.basic.util.SmsUtil;
import com.kjj.user.config.RegisterNoticeRabbitmqConfig;
import com.kjj.user.dto.RegisterNoticeDto;
import com.rabbitmq.client.AMQP;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class RegisterSmsReceiverHandler {
    @RabbitListener(queues = {RegisterNoticeRabbitmqConfig.QUEUE_INFORM_SMS})
    public void receive_email(RegisterNoticeDto registerNoticeDto, Message message, AMQP.Channel channel) {
        System.out.println(registerNoticeDto.getReceiver()+","+
                registerNoticeDto.getContent()+"已经为您发送了短信请注意查收");
        //SmsUtil.sendSms(registerNoticeDto.getReceiver(),registerNoticeDto.getContent());
    }
}
